<style>


    .pintuer .line{
        border-bottom: 1px solid #ddd;
    }
    .blank3{
        height: 0 !important;
    }

</style>
<link rel="stylesheet" href="/packages/resource/pintuer/pintuer.css">
<div class="box pintuer">

        <?php
            $m = Model()->table('proxy_apply');
            $condition = array(
                'proxy_member_id' => $distribute->getMemberId(),
                'status' => 'state_new'
            );
            $list = $m->where($condition)->order('time desc')->page(10)->select();
            if ($list) {
                foreach ($list as $item) {
                    $minfo = Model('member')->find($item['member_id']);
                    if (!$minfo) {
                        continue;
                    }
                    ?>
                    <div class="line padding-top padding-bottom">
                        <div class="x3 text-center">
                            <img src="<?php echo getMemberAvatarForID($minfo['member_id'])?>" style="width: 80%;height:80%;" alt="">
                        </div>
                        <div class="x9 padding-right">
                            <h5>
                                <?php echo $item['name']?>
                                <span class="float-right margin-right" style="font-size: 12px;color: #aaa;">
                                    <?php echo date('Y-m-d H:i:s', $item['time']) ?>
                                </span>
                            </h5>
                            <h6>
                                <?php echo ($item['msg']);?>
                            </h6>

                            <div class="margin-top text-right">
                                <a href="javascript:;" data-id="<?php echo $item['id'] ?>" class="button button-small bg-blue accept">通过</a>
                                <a href="javascript:;" data-id="<?php echo $item['id'] ?>"  class="button button-small bg-red reject">拒绝</a>
                            </div>
                        </div>
                    </div>


                    <?php
                }
            } else {

            }
        ?>


    <link rel="stylesheet" href="/packages/resource/css/pager.css"/>

    <div class="_pager margin-big-top">
        <?php
            echo $m->showpage();
        ?>
    </div>

    <div style="height: 30px;">

    </div>

</div>

<script>
    $('.reject').click(function () {
        var id = $(this).attr('data-id');
        var index = layer.load()
        $.get("/mobile/index.php?act=goods&op=deal_reject", {id: id}, function (msg) {
            if (msg == 'success') {
                layer.msg("拒绝成功", function () {
                    location.reload()
                });
            }
            else {
                layer.msg("拒绝失败", function () {
                    location.reload()
                });
            }
        });
    });

    $('.accept').click(function () {
        var id = $(this).attr('data-id');
        var index = layer.load()
        $.get("/mobile/index.php?act=goods&op=deal_accept", {id: id}, function (msg) {
            if (msg == 'success') {
                layer.msg("通过成功", function () {
                    location.reload()
                });
            }
            else {
                layer.msg("通过失败", function () {
                    location.reload()
                });
            }
        });
    });
</script>
